package com.hqj.demo.entity;

import java.util.*;

public class TestEntity {

    private String name;
    private Integer age;
    private Double height;
    private Date birthday;

    private List<String> ls;
    private Map<String,Student> ms;
    private Set<Teacher> ts;
    private Properties pros;

    public TestEntity() {}

    public TestEntity(String name, Integer age, Double height) {
        this.name = name;
        this.age = age;
        this.height = height;
    }

    public TestEntity(String name, Integer age, Double height, Date birthday) {
        this.name = name;
        this.age = age;
        this.height = height;
        this.birthday = birthday;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    public Double getHeight() {
        return height;
    }

    public void setHeight(Double height) {
        this.height = height;
    }

    public Date getBirthday() {
        return birthday;
    }

    public void setBirthday(Date birthday) {
        this.birthday = birthday;
    }

    public List<String> getLs() {
        return ls;
    }

    public void setLs(List<String> ls) {
        this.ls = ls;
    }

    public Map<String, Student> getMs() {
        return ms;
    }

    public void setMs(Map<String, Student> ms) {
        this.ms = ms;
    }

    public Set<Teacher> getTs() {
        return ts;
    }

    public void setTs(Set<Teacher> ts) {
        this.ts = ts;
    }

    public Properties getPros() {
        return pros;
    }

    public void setPros(Properties pros) {
        this.pros = pros;
    }

    @Override
    public String toString() {
        return "TestEntity{" +
                "name='" + name + '\'' +
                ", age=" + age +
                ", height=" + height +
                ", birthday=" + birthday +
                '}';
    }

    public void showList(){
        System.out.println("List集合内容:");
        for (String l:ls){
            System.out.println(l);
        }
    }

    public void showSet(){
        System.out.println("Set集合内容:");
        for (Teacher t:ts){
            System.out.println(t);
        }
    }

    public void showMap(){
        System.out.println("Map集合内容:");
        for (String key:ms.keySet()){
            Student s = ms.get(key);
            System.out.println("key="+key+",value="+s);
        }
    }

    public void showProperty(){
        System.out.println("Properties类内容:");
        for (Object obj:pros.keySet()){
            String key = obj + "";
            String value = pros.getProperty(key);
            System.out.println("key="+key+",value="+value);
        }
    }
}
